package com.da.javatest.leetCode;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @author chenlida
 * @date 2019/1/19 12:01
 * @description
 */
public class Code448 {
    public List<Integer> findDisappearedNumbers(int[] nums) {
        Set<Integer> s1 = new HashSet<>();
        Set<Integer> s2 = new HashSet<>();
        for (int i = 1; i <= nums.length; i++) {
            s1.add(i);
            s2.add(nums[i - 1]);
        }
        s1.removeAll(s2);
        return new ArrayList<>(s1);
    }
}
